# -*- coding: utf-8 -*-
# @Time    : 2021/9/9 23:00
# @Author  : BrandonGT
# @FileName: 4_10_slices.py

nums = [x for x in range(100)]
f_3 = f"first 3 numbers is {nums[0]} {nums[1]} {nums[2]}"
print(f_3)
print(nums[:3])

factor = int(len(nums) / 2)
# print(factor)
m_3 = f"first 3 numbers is {nums[factor-1]} {nums[factor]} {nums[factor+1]}"
print(m_3)
print(nums[factor-1:factor+2])

l_3 = f"first 3 numbers is {nums[-3]} {nums[-2]} {nums[-1]}"
print(l_3)
print(nums[-3:])